import Serv from './agentPosterServ'
import Config from '../../../utils/config2.js'
var regeneratorRuntime = require("../../../lib/js/runtime-module.js")

Page({
    data:{
      selectState:false
    },
    selectAgreement(){
       this.setData({
        selectState:!this.data.selectState
       })
      
    },
    goAgreement(){
      wx.navigateTo({
        url:'/subPackages2/pages/beautyNotice/beautyNotice'
      });
    },
    async submit(){
      let phoneNo = wx.getStorageSync("phoneNo");
      if(this.data.selectState){
        let { rows, success, msg } = await Serv.updateRole(phoneNo);
        if(success){
          wx.showToast({
            title: '成功',
            icon: 'success',
            duration: 2000
          })
          wx.navigateBack({
            delta: 1, // 回退前 delta(默认为1) 页面
          })
          
        }
      }else{
        wx.showModal({
          title: '提示',
          content: '请勾选同意《经纪人注册协议》'
        })
        
      }
      
    }
});